package yunwo.cn.yzstation.presenter;

import yunwo.cn.yzstation.base.BasePresenter;
import yunwo.cn.yzstation.bean.GoodsinfoitemBean;
import yunwo.cn.yzstation.model.GoodsInfoModel;
import yunwo.cn.yzstation.view.activity.CarsDetailsActivity;
import yunwo.cn.yzstation.view.fregment.carsdetail.GoodsInfoFregment;

/**
 * Created by lao on 2017/10/13.
 */

public class GoodsInfoFramgnetPresenter extends BasePresenter<IGoodsinfoView> implements IGoodsinfoModel {

    CarsDetailsActivity carsDetailsActivity;
    GoodsInfoFregment goodsInfoFregment;
    IGoodsinfoView iGoodsinfoView;
    private final GoodsInfoModel mGoodsInfoModel;

    public GoodsInfoFramgnetPresenter(CarsDetailsActivity carsDetailsActivity, GoodsInfoFregment goodsInfoFregment, IGoodsinfoView iGoodsinfoView  ) {
        this.carsDetailsActivity = carsDetailsActivity;
        this.goodsInfoFregment = goodsInfoFregment;
        this.iGoodsinfoView = iGoodsinfoView;
        mGoodsInfoModel = new GoodsInfoModel(carsDetailsActivity, this);
    }

    public void getData(String departId,String type, int page, int size) {
        mGoodsInfoModel.getData(departId,type, page, size);
    }

    @Override
    public void getDataSueecss(String type, GoodsinfoitemBean.DataBean dataBean) {
        iGoodsinfoView.getDataSueecss(type, dataBean);
    }

    @Override
    public void getDatafailure() {
        iGoodsinfoView.getDatafailure();
    }
}
